<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>八面来风</title>
		<link href="css/text.css" rel="stylesheet" type="text/css" />
		<style type="text/css">				
			.fixedBox{
				border: 5px solid #555555;				
				
			}
			.fixedBox::-webkit-scrollbar {
				width: 10px;     
				height: 10px;				
			}	
			
			a span{float: right; color: #fff;}
			li{margin-top:5px;} 
			a:link {color: #FFE4B5;}			
		</style>		
		<script type="text/javascript" src="js/json2html.js"></script>
		<script type="text/javascript" src="js/jquery.min.js"></script>
		<script>
			window.onload = function() {
				getSource();
				changeStyle();
			}
				
			function changeStyle() {
				var obj = document.getElementById("towrite");				
				obj.style.left = "0px"; 				
				obj.style.width = "96%";	
				//obj.style.height = "620px";		
				obj.style.fontSize ="14px";					
			}
			
			
			$(function() {
				setInterval(function() {
					getSource();
				},
				500);
			})
			
			var gpdm = "";
			var gpmc = "";
			var dm ="";			
			function getSource() {								
				var u = decodeURI(window.location.href);								
				if(u.indexOf("##") > -1){
					var gp = u.split('##');				
					dm = gp[1];
					gpmc = gp[2];															
				}else{
					dm = "600000";
					gpmc = "浦发银行";					
				}
				if(dm != gpdm){
					gpdm = dm;
					var sc = "";
					if(gpdm.substr(0 , 1) == "6"){				
						sc = "SH";
					}else{					
						sc = "SZ";
					}			

					var url = "http://webf10.gw.com.cn/" + sc + "/B6/" + sc + dm + "_B6.html";					
					xmlHttp = new XMLHttpRequest();							
					xmlHttp.open("GET", url, false);  //同步方式
					xmlHttp.send(null);																		
					var data = xmlHttp.responseText
					var ss = data.split("<ul id = \"newsTitleListTemp\" style='display: none;'>")[1].split("</ul>")[0];
					ss = ss.replace(/onclick="/g,'onclick="changeCss(this,\'towrite\');');
					var div = document.getElementById('towrite');
					div.innerHTML = "<font size='3' style=color:#FFFF00;>八面来风：<font size='2' color=#fff>&nbsp;&nbsp;&nbsp;&nbsp;" + gpdm + "&nbsp;&nbsp;" + gpmc + "</font></font>";										
					div.innerHTML += ss;
										
					div.scrollTop = 0; //回到顶部
				}
			}
			
			function popupNewsDetail(zxtype,riqi,newsid){			
				var url = "http://www.treeid/dlghttp://webf10.gw.com.cn/" + zxtype + "/" + riqi + "/" + newsid + ".html"
				window.open(url,'_self');
			}

			function changeCss(obj,id){				
				var alist = document.getElementById(id).getElementsByTagName("a");					
				for(var i = 0; i < alist.length; i++){
					if(alist[i].innerText != "弹出显示"){
						alist[i].style.color = "#FFDEAD"; //给所有a标签赋原色
					}
				}
				obj.style.color = "#00FFFF"; //令当前标签高亮				
			}
		</script>
	</head>
	<body>
		<div id="towrite" class="fixedBox"></div>		
	</body>
</html>